﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace FoundationLib.Ifc.Data
{
	/// <summary>
	/// Provides functionality for accessing data access sessions.
	/// </summary>
	public interface ISessionManager : IDisposable
	{
		/// <summary>
		/// Gets the currently active session.
		/// </summary>
		ISession Session
		{
			get;
		}

		/// <summary>
		/// Binds the current or a newly ceated session.
		/// </summary>
		/// <returns>The bound session</returns>
		ISession Bind();

		/// <summary>
		/// Unbinds the current session.
		/// </summary>
		/// <returns>The unbound session</returns>
		ISession Unbind();

		/// <summary>
		/// Closes the session.
		/// </summary>
		void Close();
	}
}
